<%inherit file="/base/index.html" />

<%namespace file="/base/formViews.html" name="formViews" import="*"/>
<%namespace file="/base/javascriptDefs.html" name="javascriptDefs" import="*"/>

<%def name="heading()">
    % if hasattr(c, 'browsing'):
    <h1 class="heading">Forms (${c.paginator.item_count})</h1>       
    % elif c.paginator.item_count == 1:
    <h1 class="heading">Form Results: ${c.paginator.item_count} match</h1>
    % else:
    <h1 class="heading">Form Results: ${c.paginator.item_count} matches</h1>
    % endif
</%def>

% if len(c.paginator):

<div class="allFormButtonsDiv">
 <a href="${url(controller='form', action='remember', id=None)}" class="buttonLink" title="store references to all search result Forms in Memory">remember all</a>
 <a href="${url(controller='export', action='options', id='lastsearch')}" class="buttonLink" title="export all search result Forms; you will be asked to choose a format">export all</a>
</div>

<p id="paginatorPager">${ c.paginator.pager('$link_first $link_previous $first_item to $last_item of $item_count $link_next $link_last') }</p>

${javascriptDefs.toggleLabelsJavaScript()}
<a class="buttonLink" id="toggleRowLabelsButton" title="hide labels">-</a>
<div class="tableSpacerDivHalf"></div>

<% counter=0 %>
% for form in c.paginator:
    ${formViews.formViewLong(form)}
    <% counter += 1 %>
% endfor

<p>${ c.paginator.pager('~2~') }</p>

% endif
